package net.sipvip.server;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.logging.Logger;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class VideosServlet extends HttpServlet{
	private static final Logger log = Logger.getLogger(GeneralInfoServlet.class
			.getName());
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
	throws ServletException, IOException {
		log.info("Start VideosServlet");

		Date dateNow = new Date();
		DateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
		StringBuilder now = new StringBuilder(df.format(dateNow));
		String nowstr = now.toString();
		String cookies = req.getParameter("cookies");
		String video = req.getParameter("video");
		String image = req.getParameter("image");
		String description = req.getParameter("description");
		
		PersistenceManager pm = PMF.get().getPersistenceManager();
		try {
			pm.makePersistent(new Videos(cookies, video, image,nowstr,description));

		} finally {
			pm.close();

		}
						
	}

}
